/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lenovo
 * Date: 2025-08-22
 * Time: 17:17
 */
//有三个线程，线程名称分别为：a，b，c。
//每个线程打印自己的名称。
//需要让他们同时启动，并按 c，b，a的顺序打印
public class Test {
    public static void main(String[] args) {
        Thread c=new Thread("c"){
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName());
            }
        };
        Thread b=new Thread("b"){
            @Override
            public void run() {
                try{
                    c.join();
                    System.out.println(Thread.currentThread().getName());
                }
                catch (InterruptedException e){
                    e.printStackTrace();
                }
            }
        };
        Thread a=new Thread("a"){
            @Override
            public void run() {
                try{
                    b.join();
                    System.out.println(Thread.currentThread().getName());
                }
                catch (InterruptedException e){
                    e.printStackTrace();
                }
            }
        };
        a.start();;
        b.start();
        c.start();
    }
}
